<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddUserTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user', function(Blueprint $table){
            $table->increments('id');
            $table->string('open_id', 32)->unique();
            $table->string('number', 12)->unique()->comment('学生： 学号 老师：工号');
            $table->string('name')->comment('姓名')->nullable();
            $table->integer('gender')->comment('0-女 1-男')->nullable();
            $table->string('password')->comment('密码')->nullable();
            $table->integer('role')->default(0)->comment('0- 学生 1- 老师');
            $table->string('college')->comment('学院')->nullable();
            $table->string('class')->comment('班级')->nullable();
            $table->string('major')->comment('专业')->nullable();
            $table->string('area')->comment('地区')->nullable();
            $table->string('home_address')->comment('家庭住址')->nullable();
            $table->string('dormitory_address')->comment('宿舍地址')->nullable();
            $table->string('high_school')->comment('高中')->nullable();
            $table->string('cellphone')->comment('手机号码')->nullable();
            $table->string('short_phone')->comment('短号')->nullable();
            $table->timestamp('birthday')->comment('生日')->nullable();
            $table->string('identity_number')->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('user');
    }
}
